package com.zpark.aspectj;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @PackageName: com.zpark.aspectj
 * @ClassName: ManApp
 * @Description:
 * @author: RZS
 * @date: 2023/3/30  15:03
 */
@Configuration
@ComponentScan("com.zpark")
@EnableAspectJAutoProxy
public class ManApp {
    public static void main(String[] args) {
        // 获取容器对象
        ApplicationContext app = new AnnotationConfigApplicationContext(ManApp.class);
        // 获取bean
        Man man = app.getBean("man", Man.class);
        // 使用bean
        man.manToStr();

        System.out.println("--------------------------------------");

        man.error();

    }
}
